home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / ctutor2.zip / COMPILER.DOC < prev    next >
Text File  |  1987-07-04  |  10KB  |  223 lines

  1. Coronado Enterprises Turbo C TUTOR                July 1, 1987
  2.  
  3. COMPILER.DOC file
  4.  
  5. This tutorial is written specifically for the Turbo-C compiler
  6. by Borland International.  It is written for the first release
  7. of that particular compiler, and many of the topics discussed
  8. refer to the User's Guide and Reference Guide for that particular
  9. release.  For that reason, when Borland releases a new version,
  10. some of the page numbers may be in error for the new release, but
  11. the topics will still be useable and valid.  It is written to
  12. teach you how to read and write Turbo C programs but even more
  13. important, it is intended to teach you the vocabulary of the C
  14. language so that you can intelligently read the literature about C.
  15.  
  16. Due to the ease of use of the Integrated Environment version of
  17. Turbo C, It will be used exclusively by this tutorial.  You can
  18. use the Command Line version of Turbo C with this tutorial, but
  19. all notes in the tutorial will describe use of the Integrated
  20. Environment version.
  21.  
  22.  
  23.  
  24. ******** Note - Note - Note - Note - Note - Note - Note *********
  25.  
  26. All of the files in the Coronado Enterprises Turbo C tutorial are
  27. designed to work with the Turbo C compiler with all options left
  28. in the default mode (ie - the way the compiler comes from the
  29. factory), and any changes may affect the way some of the example
  30. programs work.  For example, if you were to change the number of
  31. significant characters used for an identifier to 4, the program
  32. named SCOPE.C in chapter 5, would have all 3 functions named the
  33. same, namely "head", and the program would not work.  You would
  34. actually have other problems with this change, but they will not
  35. be commented on here.  Other kinds of errors are also possible, so
  36. it would be best that you simply use the Borland defaults for the
  37. duration of the tutorial and when you have gained experience with
  38. C, customize your compiler to suit your own taste.
  39.  
  40.  
  41.  
  42.  
  43. ****************** Suggested Hard Disk Setup *********************
  44. The Turbo C User's Guide has complete instructions describing
  45. how to set up your system for proper use.  Following the direc-
  46. tions given will result in the following directory setup if you
  47. are using a hard disk.  Some of the files have been omitted in
  48. this suggested setup to reduce the clutter in the TURBOC directory.
  49. This will reduce the confusion over extra files as you work your
  50. way through the tutorials.
  51.  
  52.  
  53.    Turbo C disk 1 - INTEGRATED DEVELOPMENT ENV.
  54.    Turbo C disk 2 - COMMAND LINE/UTILITIES
  55.    Turbo C disk 3 - HEADER FILES/LIBRARIES/EXAMPLES
  56.    Turbo C disk 4 - LIBRARIES/EXAMPLES
  57.  
  58. C:\TURBOC\
  59.     TC.EXE                  /* From Turbo C disk 1              */
  60.     TCCONFIG.TC             /* You make this file - See below   */
  61.     TCHELP.TCH              /* From Turbo C disk 1              */
  62.     *.*                     /* From Turbo C Tutor SOURCE disk   */
  63.  
  64. C:\TURBOC\INCLUDE\
  65.     *.H                     /* From Turbo C disk 3              */
  66.  
  67. C:\TURBOC\INCLUDE\SYS\
  68.     STAT.H                  /* From Turbo C disk 3 \SYS\ subdir.*/
  69.  
  70. C:\TURBOC\LIB\
  71.     *.OBJ                   /* From Turbo C disk 3              */
  72.     *.LIB                   /* From Turbo C disk 3              */
  73.     *.OBJ                   /* From Turbo C disk 4 - optional   */
  74.     *.LIB                   /* From Turbo C disk 4 - optional   */
  75.  
  76. The *.OBJ and *.LIB files from disk 4 are needed only if you wish
  77. to use additional memory models.  You only need the "Small" memory
  78. model to run all of the programs included in the Coronado Enter-
  79. prises Turbo C tutorial.
  80.  
  81. After creating the subdirectories listed above and loading them
  82. with the files listed, change to the TURBOC directory and create
  83. the TCCONFIG.TC file by following these instructions (note that
  84. the instructions are given on page 16 of the Turbo C User's guide
  85. but they are somewhat cryptic for the beginner).
  86.  
  87. 1.   TC<return>                  This loads the TURBO-C compiler
  88. 2.   O                           Selects "Options"
  89. 3.   E                           Selects "Environment"
  90. 4.   I                           Selects "Include directories"
  91. 5.   \TURBOC\INCLUDE<return>     Sets directory for include files
  92. 6.   L                           Selects "Library directory"
  93. 7.   \TURBOC\LIB<return>         Sets directory for library files
  94. 8.   <Esc>                       Returns to "Options" menu
  95. 9.   S                           Selects "Store options"
  96. 10.  <return>                    Stores file named "TCCONFIG.TC"
  97. 11.  <Esc>                       Return to the TURBO-C main menu
  98.  
  99.  
  100.  
  101.  
  102. To run your first program.  (This assumes FIRSTEX.C has been copied
  103. into the \TURBOC\ directory from the tutorial SOURCE disk.)
  104.  
  105. 1.   TC<return>                  Loads the Turbo C compiler
  106. 2.   F                           Selects "Files"
  107. 3.   L                           Selects "Load"
  108. 4.   <return>                    Lists all files *.C
  109. 5.   Position cursor on FIRSTEX.C
  110. 6.   <return>                    Loads FIRSTEX.C
  111. 7.   Alt-R                       Compiles and runs FIRSTEX
  112.  
  113.  
  114.  
  115.  
  116.  
  117. **************** Suggested Dual Floppy Disk Setup *****************
  118.  
  119. The Turbo C User's Guide has very sketchy information on how to set
  120. up the system for use from two floppies so the following information
  121. is given to get you started.  As you gain experience with the C lan-
  122. guage, you can add features and move files around to make it more
  123. convenient to use.  The setup given here will result in the source
  124. files and executable files residing on drive B.  You will develop a
  125. more convenient system soon, but this setup will get you started.
  126. You will find that you will have to stop often and erase the *.OBJ
  127. and the *.EXE files that are generated by Turbo C or your disk will
  128. fill up with these extra files.
  129.  
  130. Format a disk with the system on it (ie - FORMAT A:/S) and put the
  131. following files on it for your drive A disk.
  132.  
  133.     TC.EXE                  /* From Turbo C disk 1              */
  134.     TCCONFIG.TC             /* You make this file - see below   */
  135.     TCHELP.TCH              /* From Turbo C disk 1              */
  136.                             /* Note - You will probably have    */
  137.                             /* room for an AUTOEXEC.BAT file on */
  138.                             /* this disk also.                  */
  139.  
  140.  
  141. Format a disk without the system, make the following directories
  142. on it, and add the following files to it in their respective dir-
  143. ectories. This will be the disk for drive B.  You will put a few
  144. of the source files from the Coronado Enterprises tutorial on this
  145. disk in the root directory.
  146.  
  147. \
  148.     *.C                     /* From the Turbo C Tutor SOURCE disk */
  149.  
  150. \INCLUDE\
  151.     *.H                     /* From Turbo C disk 3                */
  152.  
  153. \INCLUDE\SYS\
  154.     STAT.H                  /* From Turbo C disk 3                */
  155.  
  156. \LIB\
  157.     COS.OBJ                 /* From Turbo C disk 3                */
  158.     CS.LIB                  /* From Turbo C disk 3                */
  159.     EMU.LIB                 /* From Turbo C disk 3                */
  160.     FP87.LIB                /* From Turbo C disk 3                */
  161.     MATHS.LIB               /* From Turbo C disk 3                */
  162.  
  163.  
  164. After creating the disks as listed above, install the disks in
  165. drive A and drive B and boot up the computer on drive A.  You
  166. must then create the TCCONFIG.TC file by following these instruc-
  167. tions (note that the instructions are given on page 14 of the Turbo
  168. C User's guide but they are somewhat cryptic for the beginner).
  169.  
  170.  
  171. 1.   TC<return>                  This loads the TURBO-C compiler
  172. 2.   O                           Selects "Options"
  173. 3.   E                           Selects "Environment"
  174. 4.   I                           Selects "Include directories"
  175. 5.   B:\INCLUDE<return>          Sets directory for include files
  176. 6.   O                           Selects "Output directory"
  177. 7.   B:\<return>                 Sets directory for output files
  178. 8.   L                           Selects "Library directory"
  179. 9.   B:\LIB<return>              Sets directory for library files
  180. 10.  <Esc>                       Returns to "Options" menu
  181. 11.  S                           Selects "Store options"
  182. 12.  <return>                    Stores file named "TCCONFIG.TC"
  183. 13.  <Esc>                       Return to the TURBO-C main menu
  184. 14.  F                           Selects the "File" menu
  185. 15.  L                           Selects the "Load" submenu
  186. 16.  B:*.C<return>               Selects the B drive for files
  187. 17.  <Esc>                       Return to the "File" menu
  188. 18.  <Esc>                       Return to the TURBO-C main menu
  189.  
  190. Note that steps 14 through 16 must be performed once each time the
  191. Turbo C system is started to tell the system where to find the
  192. working files.
  193.  
  194. To run your first program.  (This assumes FIRSTEX.C has been copied
  195. into the root directory from the tutorial SOURCE disk.)  Load the
  196. two disks into the computer and boot up the system.
  197.  
  198. 1.   TC<return>                  Loads the Turbo C compiler
  199. 2.   F                           Selects "Files"
  200. 3.   L                           Selects "Load"
  201. 4.   B:*.C<return>               Lists all files *.C
  202. 5.   Position cursor on FIRSTEX.C
  203. 6.   <return>                    Loads FIRSTEX.C
  204. 7.   Alt-R                       Compiles and runs FIRSTEX
  205.  
  206.  
  207.  
  208.  
  209. **************** Suggested Single Floppy Disk Setup ****************
  210.  
  211. In order to use the Turbo C compiler with a single floppy disk,
  212. set up two disks as noted for the Dual Floppy Disk system.  Use the
  213. disk designated for drive A above to boot up the computer and perform
  214. steps 1 through 13 given above, leaving off the drive designation for
  215. drive B in steps 5, 7, 9, and 16.
  216.  
  217. To run the system, use the disk designated for drive A for booting
  218. and loading the TC system, then install the other disk as the work-
  219. ing disk.  You will have all of the capabilities of the dual drive
  220. system except for the "HELP" facility and the ability to run an oper-
  221. ating system shell from within the Turbo C Integrated environment.
  222.  
  223.